<div class="container">

    <div class="page-header">
        <div class="row">
            <h1 class="span8">Edit SEO - <?= $post['post_title'] ?>
        </div>


    </div>

    <div class="row">

        <div class="span8">

            <form class="form-horizontal-qtrans" id="post" method="post" name="post">

                <input type="hidden" value="<?= $_GET['post_type']; ?>" name="post_type" id="post_type">
                <input type="hidden" value="<?= $post_action; ?>" name="post_action" id="post_action">

                <?
                    if ($post_action == 'EDIT') {
                        ?>
                        <input type="hidden" value="<?= $post['ID']; ?>" name="post_ID" id="post_ID">
                    <? }
                ?>

                <fieldset>


                    <div id="post-body">

                        <div id="post-body-content">

                            <!--TITLE-->
                            <? foreach (config_item('languages') as $key => $value): ?>

                                    <div class="postarea">

                                        <h3 class="qtrans_title">SEO Title <span><img src="<?= base_url() ?>assets/flags/<?= $key ?>.png" /></span></h3>

                                        <div class="qtrans_title_wrap">

                                            <?
                                            $v = isset($seo['title']) ? $seo['title'] : "";
                                            if ($v != "")
                                                $v = $this->strparse->find_lang_in_string($v, $key);
                                            ?>
                                            <input required type="text" name="title[]" class="qtrans_title_input" value="<?= $v ?>" placeholder="Page Name - Page Group  Destination name | Company Name"/>

                                        </div>

                                    </div>

                                <? endforeach; ?>

                            <br>
                            <br>

                            <!--DESCRIPTION-->
                            <? foreach (config_item('languages') as $key => $value): ?>

                                    <div class="postarea">

                                        <h3 class="qtrans_title">SEO Description <span><img src="<?= base_url() ?>assets/flags/<?= $key ?>.png" /></span></h3>

                                        <div class="qtrans_title_wrap">

                                            <?
                                            $v = isset($seo['description']) ? $seo['description'] : "";
                                            if ($v != "")
                                                $v = $this->strparse->find_lang_in_string($v, $key);
                                            ?>
                                            <input type="text" name="description[]" class="qtrans_title_input" value="<?= $v ?>" placeholder="We offer you a all type of Page Group during your vacation in Destination."/>

                                        </div>

                                    </div>

                                <? endforeach; ?>

                            <br>
                            <br>

                            <!--KEYWORD-->
                            <? foreach (config_item('languages') as $key => $value): ?>

                                    <div class="postarea">

                                        <h3 class="qtrans_title">SEO Keywords <span><img src="<?= base_url() ?>assets/flags/<?= $key ?>.png" /></span></h3>

                                        <div class="qtrans_title_wrap">

                                            <?
                                            $v = isset($seo['description']) ? $seo['description'] : "";
                                            if ($v != "")
                                                $v = $this->strparse->find_lang_in_string($v, $key);
                                            ?>
                                            <textarea cols="40" rows="3" name="keywords[]"><?
                                                $v = isset($seo['keywords']) ? $seo['keywords'] : "";
                                                if ($v != "")
                                                    $v = $this->strparse->find_lang_in_string($v, $key);

//                                    $this->firephp->log($v);
                                                echo $v;
                                                ?></textarea>
                                        </div>

                                    </div>

                                <? endforeach; ?>

                        </div>



                        <div class="form-actions">

                            <div class="row">

                                <span class="<?
                                    if ($post_action == 'EDIT') {
                                        echo 'span2 ml-15';
                                    }
                                    else
                                        echo 'span4';
                                ?> save"><button class="btn btn-primary" type="submit"><i class="icon-white icon-download-alt"></i> Save changes</button></span>
                                <span class="span4 loader"><img id="ajax-loading" class="ajax-loading" src="<?= base_url() ?>assets/img/backgnds/loading.gif" style="visibility: hidden;"></span>
                            </div>

                        </div>

                </fieldset>
            </form>

        </div>

        <div class="span4">

            <div class="hero-unit">
                <h3>SEO Descriptions</h3>
                <p>
                    <a class="btn btn-large" href="<?= base_url('seo/view_all?post_type=' . $_GET['post_type']) ?>">
                        <i class="icon-list-alt"></i> View All SEO
                    </a>
                </p>
            </div>

        </div>
    </div>

</div> <!-- /container -->
<script>
    var post_type = '<?= $_GET['post_type'] ?>';
</script>
